<template>
    <div class="color-button-background">
        <el-card class="box-card">
            <div class="color-button">渐 变 色 按 钮</div>
        </el-card>
        <el-card class="box-card">
            <div class="button hexagon">
                <span>点击这里</span>
            </div>
            <div class="triangle-button">
            </div>
        </el-card>
        <el-card class="box-card"></el-card>
    </div>
</template>
<script>
export default {};
</script>
<style  lang='less' scoped>
.color-button-background {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    .box-card {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        width: calc(100% / 4);
        height: 160px;
        margin: 10px 0;

        /deep/.el-card__body {
            width: 100%;
            display: flex;
            align-items: center;

            .color-button {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                height: 36px;
                cursor: pointer;
                background-image: linear-gradient(to right, #ff6b6b, #ee609c);
                color: white;
                padding: 10px 20px;
                border: none;
                border-radius: 4px;
                font-size: 16px;
                box-sizing: border-box;
            }
        }
    }

    .hexagon {
        position: relative;
        width: 100px;
        height: 57.74px;
        margin-right: 20px;
        background-color: #ff0000;
        /* 设置按钮的背景颜色 */
        text-align: center;
        line-height: 57.74px;
        color: #ffffff;
        /* 设置文字的颜色 */
        font-size: 14px;
        /* 设置文字大小 */
        font-weight: bold;
        /* 设置文字粗细 */
        font-family: Arial, sans-serif;
        /* 设置文字字体 */
        cursor: pointer;
    }

    .hexagon:before,
    .hexagon:after {
        content: "";
        position: absolute;
        width: 0;
    }

    .hexagon:before {
        left: 0;
        border-left: 50px solid transparent;
        /* 调整按钮大小 */
        border-right: 50px solid transparent;
        /* 调整按钮大小 */
        border-bottom: 28.87px solid #ff0000;
        /* 调整按钮大小以及底部弧度 */
        top: -27.87px;
    }

    .hexagon:after {
        left: 0;
        border-left: 50px solid transparent;
        /* 调整按钮大小 */
        border-right: 50px solid transparent;
        /* 调整按钮大小 */
        border-top: 28.87px solid #ff0000;
        /* 调整按钮大小以及顶部弧度 */
        bottom: -27.87px;
    }

    .triangle-button {
        position: relative;
        display: inline-block;
        width: 0;
        height: 0;
        border-left: 50px solid transparent;
        border-right: 50px solid transparent;
        border-bottom: 100px solid #008CBA;
        color: #fff;
        font-size: 16px;
        text-decoration: none;
        cursor: pointer;
    }
}
</style>